<!DOCTYPE HTML>
<html lang="utf-8">
<head>
<meta charset="utf-8">
<title>驾车宝典-${loginMember.nickName!}的话题</title>
<link href="${ctx}/styles/group.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/userPanel.css" rel="stylesheet" type="text/css">
<#include '/baseHead.ftl'>

<!--主要部分开始-->
<section id="main"><div class="bgA_01">
	
	<div class="userMailPanel_01"><!--这个功能块里的button标签可根据需要在 span button a 三种标签中调换-->
		<div class="menuField">
			<div class="btns">
				<a href='${ctx}/message/newmessage' class="btn btn1" title="点击撰写站内信">写站内信</href>
			</div>
			<nav class="menu">
				<ul>
					<li><a class="on" href="${ctx}/message/receive" title="进入收件箱">收件箱</a></li>
					<li><a href="${ctx}/message/send" title="进入收件箱">发件箱</a></li>
					<li></li>
				</ul>
			</nav>
		</div>
		<div class="textField">
			<div class="title">
				<p class="more"><a href="${ctx}/message/send" title="点击返回">&gt;&gt; 返回发件箱</a></p>
				<h1>${message.messageTitle!}</h1>
			</div>
			<div class="img">
				<a href="#" title="查看用户资料"><img src="${message.fromMemberHeadImage!}" width="60" height="60" alt="文艺青年ABC"></a>
			</div>
			<div class="info">
				<p><strong>来自　</strong> <a class="name" href="#" title="查看用户资料">${message.fromMemberNickName!}</a></p>
				<p><strong>时间：</strong> ${message.sendDate?datetime}</p>
			</div>
			<div class="text">
				${message.messageCont!}
			</div>
			<div class="btns">
				<#if message.toMemberId == SESSION_MEMBER_KEY.memberId>
					<!-- <button class="btn btn2" title="点击举报垃圾邮件">举报垃圾邮件</button> -->
					<#if message.isDeal == 0  && message.actionType == 1>
					<button class="btn btn1" title="点击回复" onclick='dealAddfrindMessage(1)'>同意</button>
					<button class="btn btn1" title="点击回复" onclick='dealAddfrindMessage(0)'><font color='red'>拒绝</font></button>
					</#if>
				</#if>
				<a class="btn btn1" title="点击回复" href="${ctx}/message/newmessage?memberId=${message.fromMemberId?c}">回复</a>
				<button class="btn btn1" title="删除" onclick='deleteMessage();'><font color='red'>删除</font></button>
			</div>
		</div>
	</div>
				
<#include '/commonFriendLink.ftl'>
</div></section>
<#include '/baseFoot.ftl'>
<script>
	function deleteMessage(){
	    if ( confirm("确认删除消息吗?")){
		$.ajax({
			 			type: "get",
						url: "${ctx}/message/delete${from}",
						beforeSend: function(XMLHttpRequest){
						//ShowLoading();
						},
						success: function(data, textStatus){
								alert("删除成功");
								window.location.href = "${ctx}/message/${from!}";
						},
						data:{
								checkedMessageIds:${message.mid?c}
						},
						dataType:'json'
					}
		 		)
		}
	}
	function dealAddfrindMessage(result){
		var  ss = "";
		if ( result == "1"){
			ss = "同意";
		}else{
		   ss = "拒绝";
		}
	    if ( confirm("确认"+ss+"吗?")){
		$.ajax({
			 			type: "get",
						url: "${ctx}/message/dealAddfrindMessage",
						beforeSend: function(XMLHttpRequest){
						//ShowLoading();
						},
						success: function(data, textStatus){
								window.location.reload();
						},
						data:{
								mid:${message.mid?c},
								result:result
						},
						dataType:'json'
					}
		 		)
		}
	}
	
</script>